﻿using EnterpriseWebsiteUtil.Attributes;
using EnterpriseWebsiteUtil.Helper;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace EnterpriseWebsiteTest
{
    class Program
    {
        public static readonly LangSplitHelper _langSplitHelper = new LangSplitHelper();
        static void Main(string[] args)
        {
            var s = Regex.Replace("<p><br></p>", @"<p><br><\/p>", "");

            var test = new TestDTO
            {
                name = "你好",
                nameEn = "hello",
                title = "测试",
                children = new List<ChildDTO> {
                    new ChildDTO {
                        childName = "孩子",
                        childNameEn = "child",
                        url = "http://example.com",
                        children = new List<ChildDTO>()
                        {
                            new ChildDTO()
                            {
                                childName = "孩子2",
                                childNameEn = "child2",
                                url = "http://example.com",
                            }
                        }
                    }
                }
            };

            var test2 = new ChildDTO
            {
                childName = "孩子",
                childNameEn = "child",
                url = "http://example.com"
            };

            var list = new List<ChildDTO>
            {
                new ChildDTO()
                {
                    childName = "孩子1",
                    childNameEn = "child1",
                    url = "http://example.com",
                    children = new List<ChildDTO>()
                    {
                        test2
                    }
                },
                new ChildDTO()
                {
                    childName = "孩子2",
                    childNameEn = "child2",
                    url = "http://example.com",
                    children = new List<ChildDTO>()
                    {
                        test2
                    }
                }
            };

            var result = _langSplitHelper.ConvertToLang<ChildDTO>(list, LangType.en);
            Console.ReadLine();
        }
    }
}
